package com.vivianwei.sqlfix;

import java.sql.SQLException;
import java.util.Arrays;
import java.util.List;

/**
 * @Description
 * @Author wangwei
 * @Date2021/3/9 5:14 下午
 * @Version V1.0
 **/
public class Main {
    public static void main(String[] args) throws SQLException {
//        需要修改的数据库
        List<String> tables = Arrays.asList("apollo","bue_gd","bizobj_gd","dataengine_gd","ruleengine_gd");
//        报告地址
        String excelPath = "/Users/wangwei/Documents/文稿 - 王维的MacBook Pro/gd/20210303性能优化/数据库巡检/定期巡检结果 - 数据库规范 - 省本级 - 202103.xlsx";
//        String excelPath = "/Users/wangwei/Downloads/数字财政项目 - 数据库规范 - 库表信息收集 - 同步.xlsx";
                //        生成sql修复脚本的路径
        String genPath = "/Users/wangwei/Documents/文稿 - 王维的MacBook Pro/gd/20210303性能优化/数据库巡检/sql/";

        SqlExecutor sqlExecutor = new SqlExecutor();
        sqlExecutor.add(new UTF8Process(tables,excelPath,genPath,"字符集不一致（非utf8-utf8_bin）"));
        sqlExecutor.add(new CommentProcess(tables,excelPath,genPath,"无注释"));
        sqlExecutor.add(new LengthProcess(tables,excelPath,genPath,"存二进制数据"));
//        sqlExecutor.add(new TableComments(tables,excelPath,genPath,"省本级"));
        sqlExecutor.execute();
    }



}
